home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK2.toast / Development Kits (Disc 2) / ScriptX / Documentation / Code Examples from Docs / langguid / chap_04 / xmpl_02.sx < prev    next >
Encoding:
Text File  |  1996-05-21  |  369 b   |  27 lines  |  [TEXT/ttxt]

  1. --<<<
  2. -- Kaleida Labs, Inc.
  3. -- Field Guide to the ScriptX Language
  4. -- chapter 4, example 2
  5.  
  6. -- create a module to avoid naming conflicts
  7. module Scratch14 uses ScriptX end
  8. in module Scratch14
  9.  
  10. -- declare globals
  11. global x
  12.  
  13.  
  14. -- repeat loop examples
  15. x := 10
  16. repeat while x > 0 do (
  17.     print (sin x)
  18.     x := x - 1
  19. )
  20.  
  21. x := 10
  22. repeat (
  23.     print x 
  24.     x := x - 1
  25. ) until x == 0 
  26. -->>>
  27.